package com.visizen.wisdomclass.server.client;

import com.visizen.wisdomclass.server.model.WcVersionAndroid;
import com.visizen.wisdomclass.server.model.WcVersionAndroidExample;
import com.visizen.wisdomclass.server.model.WcVersionAndroidWithBLOBs;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;

import java.util.List;

public interface WcVersionAndroidMapper {
    //从更新数据库中获取最新的一条更新记录
    @Select("SELECT * FROM WC_VERSION_ANDROID ORDER BY pubtime DESC LIMIT 1")
    WcVersionAndroidWithBLOBs getLastUpdate();

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table wc_version_android
	 * @mbggenerated
	 */
	@SelectProvider(type = WcVersionAndroidSqlProvider.class, method = "countByExample")
	int countByExample(WcVersionAndroidExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table wc_version_android
	 * @mbggenerated
	 */
	@DeleteProvider(type = WcVersionAndroidSqlProvider.class, method = "deleteByExample")
	int deleteByExample(WcVersionAndroidExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table wc_version_android
	 * @mbggenerated
	 */
	@Delete({ "delete from wc_version_android",
			"where version_id = #{version_id,jdbcType=BIGINT}" })
	int deleteByPrimaryKey(Long version_id);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table wc_version_android
	 * @mbggenerated
	 */
	@Insert({
			"insert into wc_version_android (version_id, version_code, ",
			"version_name, version_timestamp, ",
			"version_forces, pubtime, ",
			"version_content, version_apkurl)",
			"values (#{version_id,jdbcType=BIGINT}, #{version_code,jdbcType=INTEGER}, ",
			"#{version_name,jdbcType=VARCHAR}, #{version_timestamp,jdbcType=TIMESTAMP}, ",
			"#{version_forces,jdbcType=INTEGER}, #{pubtime,jdbcType=TIMESTAMP}, ",
			"#{version_content,jdbcType=LONGVARCHAR}, #{version_apkurl,jdbcType=LONGVARCHAR})" })
	int insert(WcVersionAndroidWithBLOBs record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table wc_version_android
	 * @mbggenerated
	 */
	@InsertProvider(type = WcVersionAndroidSqlProvider.class, method = "insertSelective")
	int insertSelective(WcVersionAndroidWithBLOBs record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table wc_version_android
	 * @mbggenerated
	 */
	@SelectProvider(type = WcVersionAndroidSqlProvider.class, method = "selectByExampleWithBLOBs")
	@Results({
			@Result(column = "version_id", property = "version_id", jdbcType = JdbcType.BIGINT, id = true),
			@Result(column = "version_code", property = "version_code", jdbcType = JdbcType.INTEGER),
			@Result(column = "version_name", property = "version_name", jdbcType = JdbcType.VARCHAR),
			@Result(column = "version_timestamp", property = "version_timestamp", jdbcType = JdbcType.TIMESTAMP),
			@Result(column = "version_forces", property = "version_forces", jdbcType = JdbcType.INTEGER),
			@Result(column = "pubtime", property = "pubtime", jdbcType = JdbcType.TIMESTAMP),
			@Result(column = "version_content", property = "version_content", jdbcType = JdbcType.LONGVARCHAR),
			@Result(column = "version_apkurl", property = "version_apkurl", jdbcType = JdbcType.LONGVARCHAR) })
	List<WcVersionAndroidWithBLOBs> selectByExampleWithBLOBs(
			WcVersionAndroidExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table wc_version_android
	 * @mbggenerated
	 */
	@SelectProvider(type = WcVersionAndroidSqlProvider.class, method = "selectByExample")
	@Results({
			@Result(column = "version_id", property = "version_id", jdbcType = JdbcType.BIGINT, id = true),
			@Result(column = "version_code", property = "version_code", jdbcType = JdbcType.INTEGER),
			@Result(column = "version_name", property = "version_name", jdbcType = JdbcType.VARCHAR),
			@Result(column = "version_timestamp", property = "version_timestamp", jdbcType = JdbcType.TIMESTAMP),
			@Result(column = "version_forces", property = "version_forces", jdbcType = JdbcType.INTEGER),
			@Result(column = "pubtime", property = "pubtime", jdbcType = JdbcType.TIMESTAMP) })
	List<WcVersionAndroid> selectByExample(WcVersionAndroidExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table wc_version_android
	 * @mbggenerated
	 */
	@Select({
			"select",
			"version_id, version_code, version_name, version_timestamp, version_forces, pubtime, ",
			"version_content, version_apkurl", "from wc_version_android",
			"where version_id = #{version_id,jdbcType=BIGINT}" })
	@Results({
			@Result(column = "version_id", property = "version_id", jdbcType = JdbcType.BIGINT, id = true),
			@Result(column = "version_code", property = "version_code", jdbcType = JdbcType.INTEGER),
			@Result(column = "version_name", property = "version_name", jdbcType = JdbcType.VARCHAR),
			@Result(column = "version_timestamp", property = "version_timestamp", jdbcType = JdbcType.TIMESTAMP),
			@Result(column = "version_forces", property = "version_forces", jdbcType = JdbcType.INTEGER),
			@Result(column = "pubtime", property = "pubtime", jdbcType = JdbcType.TIMESTAMP),
			@Result(column = "version_content", property = "version_content", jdbcType = JdbcType.LONGVARCHAR),
			@Result(column = "version_apkurl", property = "version_apkurl", jdbcType = JdbcType.LONGVARCHAR) })
	WcVersionAndroidWithBLOBs selectByPrimaryKey(Long version_id);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table wc_version_android
	 * @mbggenerated
	 */
	@UpdateProvider(type = WcVersionAndroidSqlProvider.class, method = "updateByExampleSelective")
	int updateByExampleSelective(
			@Param("record") WcVersionAndroidWithBLOBs record,
			@Param("example") WcVersionAndroidExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table wc_version_android
	 * @mbggenerated
	 */
	@UpdateProvider(type = WcVersionAndroidSqlProvider.class, method = "updateByExampleWithBLOBs")
	int updateByExampleWithBLOBs(
			@Param("record") WcVersionAndroidWithBLOBs record,
			@Param("example") WcVersionAndroidExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table wc_version_android
	 * @mbggenerated
	 */
	@UpdateProvider(type = WcVersionAndroidSqlProvider.class, method = "updateByExample")
	int updateByExample(@Param("record") WcVersionAndroid record,
			@Param("example") WcVersionAndroidExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table wc_version_android
	 * @mbggenerated
	 */
	@UpdateProvider(type = WcVersionAndroidSqlProvider.class, method = "updateByPrimaryKeySelective")
	int updateByPrimaryKeySelective(WcVersionAndroidWithBLOBs record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table wc_version_android
	 * @mbggenerated
	 */
	@Update({ "update wc_version_android",
			"set version_code = #{version_code,jdbcType=INTEGER},",
			"version_name = #{version_name,jdbcType=VARCHAR},",
			"version_timestamp = #{version_timestamp,jdbcType=TIMESTAMP},",
			"version_forces = #{version_forces,jdbcType=INTEGER},",
			"pubtime = #{pubtime,jdbcType=TIMESTAMP},",
			"version_content = #{version_content,jdbcType=LONGVARCHAR},",
			"version_apkurl = #{version_apkurl,jdbcType=LONGVARCHAR}",
			"where version_id = #{version_id,jdbcType=BIGINT}" })
	int updateByPrimaryKeyWithBLOBs(WcVersionAndroidWithBLOBs record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table wc_version_android
	 * @mbggenerated
	 */
	@Update({ "update wc_version_android",
			"set version_code = #{version_code,jdbcType=INTEGER},",
			"version_name = #{version_name,jdbcType=VARCHAR},",
			"version_timestamp = #{version_timestamp,jdbcType=TIMESTAMP},",
			"version_forces = #{version_forces,jdbcType=INTEGER},",
			"pubtime = #{pubtime,jdbcType=TIMESTAMP}",
			"where version_id = #{version_id,jdbcType=BIGINT}" })
	int updateByPrimaryKey(WcVersionAndroid record);
}